      SUBROUTINE PRJACC(TIME,LDPLY)
C
      IMPLICIT REAL*8(A-H,O-Z)
C
      INTEGER*2 KP1(21,4),KP2(21,4),KP
C
      REAL*4 TC1(20),TC2(20),TC
C
      COMMON/DRGCOM/ ER(3),HUBCDA(3),HUBCP(3),UJD0,HUBF(3),HUBM(3),IDRAG
C
      COMMON/IMAIN1/ IDATE,LSAVE,INOPT,IPLOT,NUMEQS,IPLTPE,IORB,ITAPE
C
      COMMON/ORJACC/ ITJ,KP(21,8),TC(20)
C
C     TIME IS UT TIME IN SECONDS FROM THE START OF THE YEAR
C
      IF(LDPLY.NE.0) GO TO 999
C
C
C     DETERMINE JULIAN DATE AT TIME 0.0 OF THE CURRENT YEAR
C
      IYEAR=1900+IDATE/10000
      IMO=1
      IDAY=1
      CALL JULDAY(IYEAR,IMO,IDAY,UJD0)
C
C     IF IDRAG = 1 USE STANDARD 1962 ATMOSPHERE
C
      IF(IDRAG.LT.2) GO TO 999
C
C     COMPUTE JULIAN DATE
C
      XJD=UJD0+TIME/86400.0D0
      TMOD=XJD-2430000.5D0
      ITA=TMOD
C
C     IDRAG = 2 SET ITJ = ITA AND USE PRESET DATA
C     IDRAG = 3 APPROPRIATE DATA SHOULD HAVE BEEN INPUT
C     IDRAG > 3 READ GSFC JACCHIA - ROBERTS DATA FILE
C
      IF(IDRAG.GT.3) GO TO 5
      IF(IDRAG.EQ.2) ITJ=ITA
      IF(ITA.GE.ITJ.AND.ITA.LE.ITJ+19) GO TO 999
      WRITE(6,600) ITA,ITJ,IDRAG
  600 FORMAT('0',5X,'THE PROBLEM MODIFIED JULIAN DATE',I8,' DOES NOT FIT
     1 THE JACCHIA - ROBERTS DATA SPAN IN COMMON STARTING AT ITJ =',I8,
     2 '.'/5X,'FOR IDRAG =',I2,' INPUT APPROPRIATE TIME SPAN OFJACCHIA -
     3 ROBERTS ATMOSPHERIC MODEL DATA.')
C
      CALL EXIT
C
    5 CONTINUE
C
C
C     READ DATA FROM GSFC DATA FILE ON UNIT 15
C
      READ(15'1) IDREC1,IDRECE,NREC,LGD
      IDREC1=IDREC1/20
      IDREC1=IDREC1*20
C
C              WHERE IDREC1 = FIRST TIME POINT, IDRECE = LAST TIME POINT
C              NREC = NO. OF RECORDS AND LGD = LAST
C              GOOD DATA POINT.
C
C     COMPUTE RECORD NUMBER IN WHICH ITA OCCURS
C
      N=(ITA-IDREC1)/20+2
      N1=N+1
C
C     CHECK TO SEE IF RECORD IS IN DATA FILE
C
      IF(N.LT.2) GO TO 900
      IF(N1.GT.NREC) GO TO 900
C
C     READ TWO RECORDS
C
      READ(15'N) IT1,KP1,TC1
      READ(15'N1) IT2,KP2,TC2
C
C     LOAD COMMON/ORJACC WITH DATA STARTING FROM ITA
C
      ITJ=ITA
C
      I1=ITA-IT1+1
      DO 10 I=I1,20
      I2=I1-I+1
      TC(I2)=TC1(I)
      KP(I2,7)=KP1(I,4)/100
      KP(I2,8)=KP1(I,4)-KP(I2,7)*100
      KP(I2,5)=KP1(I,3)/100
      KP(I2,6)=KP1(I,3)-KP(I2,5)*100
      KP(I2,3)=KP1(I,2)/100
      KP(I2,4)=KP1(I,2)-KP(I2,3)*100
      KP(I2,1)=KP1(I,1)/100
      KP(I2,2)=KP1(I,1)-KP(I2,1)*100
   10 CONTINUE
C
C
      I1=I1-1
C
      IF(I1.EQ.0) GO TO 25
C
      DO 20 I=1,I1
      I2=20-I1+I
      TC(I2)=TC2(I)
      KP(I2,7)=KP2(I,4)/100
      KP(I2,8)=KP2(I,4)-KP(I2,7)*100
      KP(I2,5)=KP2(I,3)/100
      KP(I2,6)=KP2(I,3)-KP(I2,5)*100
      KP(I2,3)=KP2(I,2)/100
      KP(I2,4)=KP2(I,2)-KP(I2,3)*100
      KP(I2,1)=KP2(I,1)/100
      KP(I2,2)=KP2(I,1)-KP(I2,1)*100
   20 CONTINUE
C
   25 CONTINUE
C
      I=I1+1
      I2=21
C
C
      KP(I2,7)=KP2(I,4)/100
      KP(I2,8)=KP2(I,4)-KP(I2,7)*100
      KP(I2,5)=KP2(I,3)/100
      KP(I2,6)=KP2(I,3)-KP(I2,5)*100
      KP(I2,3)=KP2(I,2)/100
      KP(I2,4)=KP2(I,2)-KP(I2,3)*100
      KP(I2,1)=KP2(I,1)/100
      KP(I2,2)=KP2(I,1)-KP(I2,1)*100
C
      GO TO 999
C
  900 CONTINUE
C
      WRITE(6,601) N,N1,ITA
  601 FORMAT('0',5X,'THE REQUESTED DATA RECORDS',2I4,' FOR ITA =',I8,
     1 ' ARE NOT IN THE FILE.')
C
      CALL EXIT
C
  999 CONTINUE
C
      RETURN
C
      END
